// tab页签Model
export const userList = [
  { label: "组织管理", key: "1", type: "OrgManageList" }
  // { label: "用户管理", key: "2", type: "UserManageList" },
];

const statusList = [
  { label: "正常", value: 1 },
  { label: "禁用", value: 2 }
];

// 切换页面的标识
export const tabMap = {
  userMange: 1,
  personnelManage: 2,
  roleMange: 3,
  orgRemoveRecordList: 4,
  organizerRemoveRecordList: 5,
  inviteRecordList: 6,
  identityRemoveRecordList: 7,
  businessConfig: 8,
  resourceManage: 9
}

export const tabList = [
  { name: "userManage", key: 1 },
  { name: "personnelManage", key: 2 },
  { name: "roleManage", key: 3 },
  { name: "recordList", key: 4 },
  { name: "recordList", key: 5 },
  { name: "recordList", key: 6 },
  { name: "recordList", key: 7 },
  { name: 'businessConfig', key: 8 },
  { name: 'resourceManage', key: 9 }

]
// 用户列表表头
export const userColumns = [
  {
    title: '用户名',
    dataIndex: "account",
    key: "account"
  },
  {
    title: "手机号",
    dataIndex: "phone",
    key: "phone"
  },
  {
    title: "账号状态",
    dataIndex: "status",
    key: "status",
    customRender(text) {
      let target = statusList.find((i) => i.value === text);
      return target?.label || text || "";
    }
  },
  {
    title: "部门",
    dataIndex: "type",
    key: "type"
  },
  {
    title: "注册时间",
    key: "createdTime",
    dataIndex: "createdTime",
    scopedSlots: { customRender: "createdTime" }
  },
  {
    title: "操作",
    key: "oper",
    width: 150,
    scopedSlots: { customRender: "oper" },
    fixed: 'right'
  }
];

export const orgColumns = [
  {
    width: 300,
    title: "组织名称",
    key: "name",
    dataIndex: "name"
  },
  {
    width: 420,
    title: "组织配置",
    scopedSlots: { customRender: "department" }
  },
  {
    title: "基础操作",
    width: 300,
    scopedSlots: { customRender: "operations" },
    fixed: 'right'
  },
  {
    title: "高级操作",
    scopedSlots: { customRender: "advancedOperations" },
    fixed: 'right'
  }
];

// 组织人员表头
export const personnelColumns = [
  {
    title: "用户名",
    dataIndex: "account",
    key: "account"
  },
  {
    title: "姓名",
    dataIndex: "username",
    key: "username"
  },
  {
    title: "当前手机号",
    dataIndex: "phone",
    key: "phone"
  },
  {
    title: "应用管理",
    dataIndex: 'application',
    scopedSlots: { customRender: "application" }
  },
  {
    title: "账号状态",
    dataIndex: "status",
    key: "status",
    customRender(text) {
      let target = statusList.find((i) => i.value === text);
      return target?.label || text || "";
    }
  },
  {
    title: "注册时间",
    key: "createTime",
    dataIndex: "createTime"
  },
  {
    title: "操作",
    scopedSlots: { customRender: "operations" },
    fixed: 'right'
  }
];

// 角色列表表头
export const roleColumns = [
  {
    title: '身份名称',
    dataIndex: "name",
    key: "name",
    width: 140
  },
  {
    title: "备注信息",
    dataIndex: "remark",
    key: "remark",
    width: 150
  },
  {
    title: "注册时间",
    key: "createTime",
    dataIndex: "createTime",
    width: 180
  },
  {
    title: '数据权限',
    width: 200,
    scopedSlots: { customRender: 'dataAuthority' }
  },
  {
    title: "栏目权限",
    width: 180,
    scopedSlots: { customRender: "operationsAuthority" }
  },
  {
    title: "人员列表",
    width: 120,
    scopedSlots: { customRender: "personnelList" }
  },
  {
    title: "操作",
    width: 200,
    key: "operations",
    scopedSlots: { customRender: "operations" },
    fixed: 'right'
  }
];

// 移除组织列表纪录表头
export const removeOrgColumns = [
  {
    title: "组织名称",
    dataIndex: "name",
    key: "name"
  },
  {
    title: "移除人",
    dataIndex: "updateBy",
    key: "updateBy"
  },
  {
    title: "移除时间",
    dataIndex: "updateTime",
    key: "updateTime"
  }
];

// 移除组织人员列表表头
export const removeOrganizerColumns = [
  {
    title: "用户名",
    dataIndex: "account",
    key: "account"
  },
  {
    title: "姓名",
    dataIndex: "username",
    key: "username"
  },
  {
    title: "手机号",
    dataIndex: "phone",
    key: "phone"
  },
  {
    title: "账号状态",
    dataIndex: "status",
    key: "status",
    customRender(text) {
      let target = statusList.find((i) => i.value === text);
      return target?.label || text || "";
    }
  },
  {
    title: "注册时间",
    dataIndex: "createTime",
    key: "createTime"
  },
  {
    title: "移除人",
    dataIndex: "updateBy",
    key: "updateBy"
  },
  {
    title: "移除时间",
    dataIndex: "updateTime",
    key: "updateTime"
  }
]

// 资源配置表头
export const resourceColumns = [
  {
    title: "序号",
    dataIndex: "order",
    key: "order"
  },
  {
    title: "项目",
    dataIndex: "resourceId",
    key: "resourceId"
  },
  {
    title: "资源类型",
    dataIndex: "resourceTypeName",
    key: "resourceTypeName"
  },
  {
    title: "资源数量",
    dataIndex: 'detailSize',
    key: "detailSize"
  }
];

// 邀请记录表格
export const inviteColumns = [
  {
    title: "用户名",
    dataIndex: "account",
    key: "account"
  },
  {
    title: "姓名",
    dataIndex: "username",
    key: "username"
  },
  {
    title: "手机号",
    dataIndex: "phone",
    key: "phone"
  },
  {
    title: "账号状态",
    dataIndex: "status",
    key: "status",
    customRender(text) {
      let target = statusList.find((i) => i.value === text);
      return target?.label || text || "";
    }
  },
  /*
  {
    title: "邀请时间",
    dataIndex: "invatitionTime",
    key: "invatitionTime"
  },
  {
    title: "移除人",
    dataIndex: "removeUser",
    key: "removeUser"
  },
  {
    title: "移除时间",
    dataIndex: "removeTime",
    key: "removeTime"
  },
  */
  {
    title: "身份名称",
    dataIndex: "roleName",
    key: "roleName"
  }
]

export const identityColumns = [
  {
    title: "身份名称",
    dataIndex: "name",
    key: "name"
  },
  {
    title: "备注信息",
    dataIndex: "remark",
    key: "remark"
  },
  {
    title: "注册时间",
    dataIndex: "createTime",
    key: "createTime"
  },
  {
    title: "移除人",
    dataIndex: "updateBy",
    key: "updateBy"
  },
  {
    title: "移除时间",
    dataIndex: "updateTime",
    key: "updateTime"
  }
]

// 记录列表标题MAP
export const CRUMBS_MAP = {
  4: "移除列表",
  5: "移除列表",
  6: "邀请记录",
  7: "移除列表"
};

// 服务api MAP
export const SERVICE_FUNC = {
  4: 'getRemoveOrgList',
  5: 'getRemoveLOrganizerList',
  6: 'getInviteList',
  7: 'getRemoveIdentityList'
}

// 服务接口数据 MAP
export const DATA_MAP = {
  4: "departmentList",
  5: "users",
  6: "invitations",
  7: "roleList"
};
